#include <stdlib.h>
#include <math.h>
#include <string.h>

extern unsigned char cstring[7];
extern float h0;
double INIT_altitude,DIFFERENCE_altitude,CHANGE_altitude;
double dpresure,daltitude,daltitude1;
void getInitialAlt()
{
	dpresure=atof(cstring);
	dpresure=dpresure/100;
	daltitude=pow(dpresure,0.1902631);
	daltitude=3.731444-daltitude;
	daltitude=daltitude/0.841728e-4;
	daltitude1=daltitude;
}

void VIBERATE_altitude()
{
	dpresure=atof(cstring);
	dpresure=dpresure/100;
	daltitude=pow(dpresure,0.1902631);
	daltitude=3.731444-daltitude;
	daltitude=daltitude/0.841728e-4;
	CHANGE_altitude=daltitude-daltitude1;
	INIT_altitude=INIT_altitude+CHANGE_altitude;
	daltitude1=daltitude;
}

int matherr (struct exception *a)
{
  if (a->type == DOMAIN)
    if (!strcmp(a->name,"pow")) {
      a->retval = pow (-(a->arg1),0.1902631);
    return 1;
    }
  return 0;
}